package com.hnmqet.demo03.service;

import io.seata.rm.tcc.api.BusinessActionContext;
import io.seata.rm.tcc.api.BusinessActionContextParameter;
import io.seata.rm.tcc.api.LocalTCC;
import io.seata.rm.tcc.api.TwoPhaseBusinessAction;

/**
 * Created by TD on 2022/1/26
 */
@LocalTCC
public interface StorageTccService {


    @TwoPhaseBusinessAction(name = "reduceStorage" , commitMethod = "commit", rollbackMethod = "rollback")
    void reduceStorage(@BusinessActionContextParameter(paramName = "code") String code, @BusinessActionContextParameter(paramName = "count") Long count);


    boolean commit(BusinessActionContext actionContext);

    boolean rollback(BusinessActionContext actionContext);
}
